package com.wzcl.app.dao.model;

import com.wzcl.app.dao.model.common.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@Table(name = "SendPath",
    indexes = {
        @Index(columnList = "userPhone"),
    }
)
@ApiModel(value = "配送地址表")
@EntityListeners(AuditingEntityListener.class)
public class SendPath implements Base {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "用户Id")
    private Integer userId;

    @ApiModelProperty(value = "用户手机")
    private String userPhone;

    @ApiModelProperty(value = "创建时间")
    @CreatedDate
    private Date createTime;

    @ApiModelProperty(value = "详细地址")
    private String path;

    @ApiModelProperty(value = "详细地址")
    private String pathInfo;

    @ApiModelProperty(value = "收货人姓名")
    private String name;

    @ApiModelProperty(value = "收货人手机号")
    private String phone;

    @ApiModelProperty(value = "状态")
    private Integer state;

    @ApiModelProperty(value = "是否为默认地址")
    private Boolean isDefault;
}